const { ccclass, property } = cc._decorator;
import { UICtrl } from '../../Managers/UIMgr';
@ccclass
export class LoginUI_Ctrl extends UICtrl {
    protected onLoad(): void {
        super.onLoad();

        // 更新版本信息
        this.updateVersion('2.l0.0');

        // 增加事件监听
        this.addBtnEventListener();

        console.log(this.view);
    }

    public updateVersion(version: string): void {
        const versionNode = this.view['version'];

        console.log(versionNode);
        const label = versionNode.getComponent(cc.Label);
        console.log(label);
        // const label = versionNode.getComponent(cc.Label);
        label.string = version;
        versionNode.color = cc.Color.RED;
    }

    private addBtnEventListener(): void {
        this.add_button_listen('btn_login', this, this.onBtnLoginClick);
    }

    private onBtnLoginClick(): void {
        console.log('onBtnLoginClick');
    }
}
